/**
 * Created by wang on 2015-11-20.
 */
define(['angular', 'store'], function (angular, store) {
    "use strict";

    var factory = function ($location,$http,$q,$sce,WT_BASE_PATH,WZ_BASE_PATH,CommonService,LocalCacheService) {

        return {
            getCaptcha: function () {
                var params = {};
                params.url = "/boss/get_captcha";
                params.type = "get";
                return CommonService.ajax(params);
            },
            login: function (data) {
                var params = {};
                data.op_station = LocalCacheService.get("op_station");
                params.url = "/trade/user/login"; //denglu
                params.styleType = 1;
                params.data = data;
                params.isLogin = true;
                return CommonService.ajax(params);
            },
            loginWithoutCaptcha: function (data) {
                var params = {};
                data.op_station = LocalCacheService.get("op_station");
                params.url = "/trade/user/login";
                params.styleType = 1;
                params.data = data;
                params.isLogin = true;
                return CommonService.ajax(params);
            },
            getUserInfo: function () {
                var params = {};
                params.url = "/trade/user/get_user";
                params.isReject = true; //是否会覆盖错误提示 默认是弹窗
                params.type = "get";
                return CommonService.ajax(params);
            },
            syncUserCare: function (data) {
                var params = {};
                params.data = data;
                params.url = "/trade/user/sync_user_care";
                return CommonService.ajax(params);
            },
        }
    };

    factory.$inject = ['$location','$http','$q','$sce','WT_BASE_PATH','WZ_BASE_PATH','CommonService','LocalCacheService'];
    return factory;
});